﻿<UserControl x:Class="IntegrationTool.DataMappingControl.MappingControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	x:Name="UserControl"         
    d:DesignHeight="464" d:DesignWidth="478" SizeChanged="UserControl_SizeChanged">
    <UserControl.Resources>
        <Style TargetType="Label">
            <Setter Property="FontSize" Value="42" />
        </Style>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Grid.Row="0" Grid.ColumnSpan="3">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="2*" />
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="2*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="22" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid Grid.Column="0" Grid.Row="0" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Button Content="▲" Name="btnSortDownSl" Click="SortLeftSide" Grid.Column="0" Tag="desc" >
                <Button.ToolTip>
                    <TextBlock Foreground="Black" Text="Von A bis Z sortieren" VerticalAlignment="Center" />
                </Button.ToolTip>
            </Button>
        </Grid>

        <Grid Grid.Column="2" Grid.Row="0" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Button x:Name="btnSortDownTl" Click="SortRightSide" Tag="desc" Grid.Column="0">
                <Button.Content>▲</Button.Content>
                <Button.ToolTip>
                    <TextBlock Text="Von A bis Z sortieren" VerticalAlignment="Center" Foreground="Black"/>
                </Button.ToolTip>
            </Button>
        </Grid>

        <ScrollViewer Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" x:Name="myScrollViever2" VerticalScrollBarVisibility="Hidden" >
            <Canvas x:Name="mainCanvas" />
        </ScrollViewer>

        <ScrollViewer Grid.Column="0" Grid.ColumnSpan="1" Grid.Row="2" x:Name="myScrollViever" VerticalScrollBarVisibility="Visible" Background="White"   ScrollChanged="myScrollViever_ScrollChanged">
            <ContentControl x:Name="ccMainCanvas" AllowDrop="True" VerticalAlignment="Top">
                <Grid>
                    <ListView HorizontalAlignment="Left" Width="150" IsSynchronizedWithCurrentItem="True" x:Name="ListBoxSource" ItemsSource="{Binding Path=SourceList, ElementName=UserControl, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" BorderThickness="0,0,0,0" MouseDoubleClick="ListBoxSource_MouseDoubleClick"  >
                        <ListView.ItemsPanel>
                            <ItemsPanelTemplate>
                                <VirtualizingStackPanel />
                            </ItemsPanelTemplate>
                        </ListView.ItemsPanel>
                    </ListView>
                </Grid>
            </ContentControl>
        </ScrollViewer>
        <ScrollViewer Grid.Column="2" Grid.Row="2"  x:Name="myScrollVievert" VerticalScrollBarVisibility="Visible"  ScrollChanged="myScrollVievert_ScrollChanged" >
            <ContentControl  x:Name="mainCanvast" AllowDrop="True" HorizontalAlignment="Stretch">
                <ListView ScrollViewer.VerticalScrollBarVisibility="Hidden" IsSynchronizedWithCurrentItem="True" x:Name="ListBoxTarget" ItemsSource="{Binding Path=TargetList, ElementName=UserControl, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" BorderThickness="0,0,0,0" SelectionChanged="ListBoxTarget_SelectionChanged">
                    <ListView.ItemsPanel>
                        <ItemsPanelTemplate>
                            <VirtualizingStackPanel />
                        </ItemsPanelTemplate>
                    </ListView.ItemsPanel>
                </ListView>
            </ContentControl>
        </ScrollViewer>

        <Rectangle Grid.Row="1" Stroke="Gray" StrokeThickness="1" Grid.ColumnSpan="3" />
        <Rectangle Grid.Row="0" Grid.RowSpan="2" Stroke="Gray" StrokeThickness="1" HorizontalAlignment="Right" />
        <Rectangle Grid.Row="0" Grid.RowSpan="2" Grid.Column="1" Stroke="Gray" StrokeThickness="1" HorizontalAlignment="Right" />
        <Border BorderThickness="1" Grid.RowSpan="3" Grid.ColumnSpan="3" BorderBrush="Gray" />
    </Grid>





</UserControl>
